package com.sky.mapper;

import com.sky.entity.OrderDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author 山顶洞人郑某
 * @className OrderDetailMapper.java
 * @date 2024 02 12
 */
@Mapper
public interface OrderDetailMapper {
    /**
     * 批量添加订单明细
     * @param orderDetailist
     */
    void insertBatch(List<OrderDetail> orderDetailist);

    /**
     * 根据id查询订单详情
     * @param id
     * @return
     */
    @Select("select * from sky_take_out.order_detail where order_id = #{id}")
    List<OrderDetail> getByOrderId(Long id);
}
